falloutmodsfandomcom-20200214-history
SAVE.DAT File Format
Introduction First, a little explanation: ASCII (C-style) strings end with a 0 byte - the hex value 0x0, not the character '0'. So, if the length of an ASCII string is 32, it can contain 31 characters with 0x0 at the end. Most numbers are written as four byte integers, in big-endian (most significant byte first) format. Negative numbers are stored in two's complement format (e.g. -1 is 0xFFFFFFFF). The data in a save.dat file is not written all at once, but in a series of separate functions. This can be seen when examining debug files (debug.log). When saving it has the following entries: LOADSAVE: Save file header size written: XXXX bytes. LOADSAVE: Save function #X data size written: XXXX bytes. ... where X is some number This is done because different functions save different types of data (about quests, items, etc.). All the data is recorded sequentially. Therefore, to describe the file we divide the data into separate functions. There are 27 functions (not including the header). The numbering starts with zero. Because parts of the data have variable sizes, it can be fairly difficult to find a particular part of the data. It is considerably easier with the help of the file description and looking in debug.log for the size of the right function. Note: offsets for each function (beginning with the fourth) are shown relative to the end of the previous one. SAVE.DAT Format Header Size: 0x7563 bytes. Function #0 Size: 0x00 bytes. This function never writes anything. Function #1 Size: 0x04 bytes. Function #2 Size: variable. In Fallout 2 v1.02d it is 0x0AE0 bytes. Function #3 Size: variable. Function #4 Size: variable. In Fallout 2 v1.02d it is 0x0AE0 bytes. This is an exact duplicate of Function #2. It's not known why this was done. Function #5 Size: variable. Function #6 Size: 0x0178 bytes. This section has the same format as PRO files for critters, starting at offset 0x30 in the PRO file. Function #7 Size: 0x4C. Men Women Children Super mutants Ghouls Brahmin Radscorpions Rats Foaters Centaurs Robots Dogs Manti Deathclaws Plants Geckos Aliens Giant ants Big Bad Boss Function #8 Size: 0x10. 0x00: Fast Metabolism 0x01: Bruiser 0x02: Small Frame 0x03: One Hander 0x04: Fnesse 0x05: Kamikaze 0x06: Heavy Handed 0x07: Fast Shot 0x08: Bloody Mess 0x09: Jinxed 0x0A: Good Natured 0x0B: Chem Reliant 0x0C: Chem Resistant 0x0D: Sex Appeal (In Fallout 1 this was Night Person) 0x0E: Skilled 0x0F: Gifted Function #9 Size: 0x02C8. Function #10 Size: variable. In Fallout 2 v1.02d it is 0x3058 bytes. Function #11 Size: 0x04 when not in combat; variable when in combat. Function #12 Size: variable. Function #13 Size: 0x14. Function #14 Size: 0x00 bytes. This function never writes anything. Function #15 Size: 0x08 bytes. Function #16 Size: 0x04 bytes. Function #17 Size: 0x50 bytes. Function #18 Size: 0x05 bytes. Function #19 Size: variable. In Fallout 2 v1.02d it is 0x0AE0 bytes. The contents of this function are the same as worldmap.dat . Function #20 Size: 0x00 bytes. This function never writes anything. Function #21 Size: 0x11 bytes. Function #22 Size: 0xD8 bytes. Function #23 Size: variable. Function #24 Size: variable. Function #25 Size: 0x10 bytes. Function #26 Size: 0x00 bytes. This function never writes anything. Inventory item format (This is correct for the Mac version of FO2; the PC version may be slightly different.) City record format Special encounter record format Party member AI record format Original document at TeamX (in russian) Category:Fallout and Fallout 2 file formats Category:Translated TeamX documents